<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/stack-overflow.js"></script>
<script>

// This test unhelpfully crashes in IsReadableStream when compiled with DCHECKs
// enabled. For best coverage, it should be compiled without DCHECKs.
test(() => {
  const rs = new ReadableStream();
  const response = new Response(rs);
  try {
    // This throws different errors depending on how Blink is built, so
    // assert_throws_{js, dom}() cannot be used.
    fillStackAndRun(() => response.clone(), 784);
    assert_unreached('stack should overflow');
  } catch (e) {
  }
}, 'stack overflow in clone() should not crash the browser');
</script>
